package demo07.simpleremote;

/**
 * 测试
 * */
public class RemoteControlTest {
	public static void main(String[] args) {
		SimpleRemoteControl remote = new SimpleRemoteControl();
		Light light = new Light();
		GarageDoor garageDoor = new GarageDoor();
		LightOnCommand lightOn = new LightOnCommand(light);
		GarageDoorOpenCommand garageOpen = 
		    new GarageDoorOpenCommand(garageDoor);
 
		remote.setCommand(lightOn);//开灯
		remote.buttonWasPressed();
		
		remote.setCommand(garageOpen);//开门
		remote.buttonWasPressed();
	/*	灯着了
		车库门是开着的*/
    }
}
